import time
import easygui
def Mao_pao(num=list):
	n=len(num)
	for i in range(0,n-1):
		for j in range(0,n-1-i):
			if num[j]>num[j+1]:
				num[j],num[j+1]=num[j+1],num[j]
	return num
def Xuan_ze(num=list):
	n=len(num)
	for i in range(0,n-1):
		k=i
		for j in range(0,n-1-k):
			if num[k]>num[j]:
				num[k],num[j]=num[j],num[k]
	return num
lis=input('请输入一串无序的数字（每个数之间用“，”隔开）')
lis=lis.replace(',',' ')
try:	
	lis=list(map(int,lis.split()))
	a=time.time()
	Mao_pao(lis)
	b=time.time()
	print(b-a)
	a=time.time()
	Xuan_ze(lis)
	b=time.time()
	print(b-a)
	# lis2=','.join(map(str,lis)).split(',')
	# print(lis)
	if Mao_pao(lis)==Xuan_ze(lis):
		print(Mao_pao(lis))
except:
	easygui.msgbox('请不要在数字中加一些字母或奇怪字符😊')